package com.shiguiwu.springmybatis.spring.aop.aspect;

import org.springframework.aop.aspectj.annotation.AspectJProxyFactory;

/**
 * @description: 测试
 * @author: stone
 * @date: Created by 2021/6/10 10:27
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.aop.aspect
 */
public class AspectTestsV2 {

    public static void main(String[] args) {
        AspectJProxyFactory proxyFactory = new AspectJProxyFactory();
        AspectServiceV2 target = new AspectServiceV2();
        //设置目标对象
        proxyFactory.setTarget(target);
        //添加切面
        proxyFactory.addAspect(MyAspectV1.class);

        AspectServiceV2 proxy = proxyFactory.getProxy();
        proxy.m1();
//        proxy.m2();
        proxy.m3();
        proxy.m4();

    }
}
